package com.example.zlpermissionservice.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author zhenliu（孙凌岳）
 * @Description AI生成 - 角色资源关联实体类
 * @Date 2025/6/17 21:13
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@TableName("sys_role_resource")
public class RoleResource implements Serializable {
    /**
     * 数据状态（0正常 1停用）
     */
    private String dataState;

    /**
     * 资源编号

     */
    private String resourceNo;

    /**
     * 角色ID
     */
    private Long roleId;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键")
    public Long id;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updateTime;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private Long createBy;

    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private Long updateBy;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String creator;

    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private String updater;

//    /**
//     * 请求参数 (JsonIgnore is used to exclude it from Swagger docs)
//     */
//    @JsonIgnore
//    private Map<String, Object> params;

//    public Map<String, Object> getParams() {
//        if (params == null) {
//            params = new HashMap<>();
//        }
//        return params;
//    }

    @Builder
    public RoleResource(String dataState, String resourceNo, Long roleId, Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createBy, Long updateBy, String remark, String creator, String updater) {
        this.dataState = dataState;
        this.resourceNo = resourceNo;
        this.roleId = roleId;
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createBy = createBy;
        this.updateBy = updateBy;
        this.remark = remark;
        this.creator = creator;
        this.updater = updater;
//        this.params = params;
    }
}
